<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.25" charset="UTF-8">
    <title>Edit Category</title>
    <link rel="StyleSheet" th:href="@{/css/jpetstore.css}" type="text/css" media="screen"/>
</head>
<body>
<header th:replace="common/top"></header>
<div id="Content">
    <h2 th:text="${category.categoryId} != null ? 'Edit Category' : 'Add Category'"></h2>
    <form th:action="@{/catalog/save}" th:object="${category}" method="post">
        <div>
            <label>Name:</label>
            <input type="text" th:field="*{name}"/>
        </div>
        <div>
            <label>Description:</label>
            <input type="text" th:field="*{description}" />
        </div>
        <div>
            <button type="submit">Save</button>
        </div>
    </form>
    <a th:href="@{/catalog/list}">Back to List</a>
</div>
<footer th:replace="common/bottom"></footer>

<!--脚本-->
<script th:src="@{/js/background.js}" count="500"></script>
</body>
</html>
